import useSettingsStore from './settings'

const useLayoutStore = defineStore(
  // 唯一ID
  'layout',
  () => {
    //

    const settingsStore = useSettingsStore()

    //     // 标签栏高度
    // --ik-tabbar-height: 28px;
    // // 面包屑高度
    // --ik-breamcrumb-height: 17px;
    // // 工具栏高度
    // --ik-toolbar-height: 64px;
    const headerHeight = computed(() => {
      const toolbarHeight = 64
      let tabbarHeight = 0
      let breadcrumbHeight = 0
      const tabbar = settingsStore.settings.tabbar.enable
      if (tabbar) {
        //
        tabbarHeight = 28
      }
      const breadcrumb = settingsStore.settings.breadcrumb.enable
      if (breadcrumb) {
        //
        breadcrumbHeight = 17 + 22
      }
      return `${toolbarHeight + tabbarHeight + breadcrumbHeight}px`
    })

    return {
      headerHeight
    }
  }
)

export default useLayoutStore
